Security News
NVD Backlog Tops 20,000 CVEs Awaiting Analysis as NIST Prepares System Updates
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
void-elements
Advanced tools
The void-elements npm package provides a list of HTML void elements. Void elements are HTML elements that do not have closing tags, such as <img>, <br>, and <input>. This package is useful for developers who need to handle or validate HTML content programmatically.
List of Void Elements
This feature provides a list of all HTML void elements. The code sample demonstrates how to import the package and log the list of void elements to the console.
const voidElements = require('void-elements');
console.log(voidElements);
Check if an Element is Void
This feature allows you to check if a given HTML tag is a void element. The code sample shows how to create a function that checks if a tag name is in the list of void elements and demonstrates its usage with 'img' and 'div' tags.
const voidElements = require('void-elements');
const isVoidElement = (tagName) => voidElements.includes(tagName);
console.log(isVoidElement('img')); // true
console.log(isVoidElement('div')); // false
The html-tags package provides a list of all standard HTML tags, including both void and non-void elements. It is more comprehensive than void-elements as it covers all HTML tags, not just void elements.
The self-closing-tags package offers a list of self-closing HTML tags, which is similar to void elements. However, it focuses on tags that can self-close in XML and XHTML contexts, which may include more than just the standard HTML void elements.
Exports an Array of "void element" node names as defined by the HTML spec.
The list is programatically generated from the latest W3C HTML draft.
var voidElements = require('void-elements');
assert(voidElements.indexOf('span') === -1, '<span> is not a void element');
assert(voidElements.indexOf('img') !== -1, '<img> is a void element');
MIT
FAQs
Array of "void elements" defined by the HTML specification.
The npm package void-elements receives a total of 6,246,122 weekly downloads. As such, void-elements popularity was classified as popular.
We found that void-elements demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.